package cn.tedu.thrid;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;

@Component

public class Test01 {
    @Test
    public void test02(){
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("beans.xml");
        Demo demo = (Demo) applicationContext.getBean("demo");
        System.out.println(demo);
        ((ClassPathXmlApplicationContext)applicationContext).close();
    }
}
